﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.ComponentModel;

namespace TempEmployees.Web
{
    public abstract class BaseDisplayTextBox : BaseDataDisplay, ITextControl
    {
        public virtual string Text {get; set;}

        public static implicit operator string(BaseDisplayTextBox textBox)
        {
            return textBox.Text;
        }

        public static implicit operator int(BaseDisplayTextBox textBox)
        {
            int value;
            if (!int.TryParse(textBox.Text, out value)) return int.MinValue;
            return value;
        }
    }
}
